//
//  NetWorkingTools.swift
//  MyWeiboApp
//
//  Created by 胡海波 on 15/6/27.
//  Copyright © 2015年 胡海波. All rights reserved.
//

import UIKit
import AFNetworking

class NetWorkingTools: AFHTTPSessionManager {

    private static let instance: NetWorkingTools = {

        let urlString = "https://api.weibo.com/"
        let baseURL = NSURL(string: urlString)!


        let tools = NetWorkingTools(baseURL: baseURL)

        tools.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript","text/plain") as Set<NSObject>

        return tools
    }()

    ///  全局访问方法
    class func shareNetworkTools() -> NetWorkingTools {

        return instance
    }
}
